package com.kwin.servlet;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

public class UserDB {
    private static List<User> list = new ArrayList<>();

    static {
        list.add(new User("aaa", "111"));
        list.add(new User("bbb", "222"));
        list.add(new User("ccc", "333"));
    }

    public static User find(String username, String password) {
        for (User user : list) {
            if (user.getUsername().equals(username) && user.getPassword().equals(password)) {
                return user;
            }
        }
        return null;
    }
}
